package org.third.common.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

@Entity
@Table(name = "feature")
public class Feature {

	//https://howtoprogramwithjava.com/hibernate-onetoone-annotation/
	@Id  
    @GeneratedValue(generator="MyGenerator")
    @GenericGenerator(name="MyGenerator", strategy="foreign", parameters=@Parameter(value="deployment", name = "property"))  
	@Column(name="deployment_id")
	private Long deploymentId;

	@Column(name = "feature", nullable = false)
	@Lob
	private String feature;
	
	@OneToOne(cascade=CascadeType.ALL, fetch = FetchType.LAZY)  
	@JoinColumn(name="deployment_id")
	private Deployment  deployment;

	public Long getDeploymentId() {
		return deploymentId;
	}

	
	public void setDeploymentId(Long deploymentId) {
		this.deploymentId = deploymentId;
	}

	public Deployment getDeployment() {
		return deployment;
	}

	public void setDeployment(Deployment deployment) {
		this.deployment = deployment;
	}

	public String getFeature() {
		return feature;
	}

	public void setFeature(String feature) {
		this.feature = feature;
	}

}